package org.kongqian.gift.client;


import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.kongqian.gift.domain.LoginUser;
import org.kongqian.gift.util.AjaxResult;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class LoginUserClientFallbackFactory implements FallbackFactory<LoginUserClient> {
    @Override
    public LoginUserClient create(Throwable cause) {
        return new LoginUserClient() {
            @Override
            public AjaxResult addOrUpdate(LoginUser loginUser) {
                log.error("系统错误:"+cause.getMessage());
                return AjaxResult.me().setSuccess(false).setMessage("系统错误！");
            }
        };
    }
}
